const Router = require('@koa/router');
const authController = require('../controller/auth.controller');
const auth = require('../middleware/auth');

const router = new Router({
  prefix: '/api/auth'
});

// 登录
router.post('/login', authController.login);

// 获取当前用户信息
router.get('/current-user', auth, authController.getCurrentUser);
router.get('/current', authController.logout);

// 退出登录
router.post('/logout', auth, authController.logout);

module.exports = router; 